package com.hs.biye.handler;

import com.hs.biye.excepction.BaseException;
import com.hs.biye.model.reslut.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler
    public Result exceptionHandler(BaseException e){
        return Result.faile(e.getMessage());
    }

}
